﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BOHVote.BLL;

namespace BOH.AccreditationSystem
{
    public partial class InterviewQuestionsSelectPassyear : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SubjectBind();
                BindApplyPeriod();
            }
        }

        public void SubjectBind()
        {
            this.drpSubject.Items.Clear();
            DataSet dst = Subject.getAllASubject();
            //dst = Subject.
            ListItem li1 = new ListItem("请选择学科组", "-1");
            this.drpSubject.Items.Add(li1);
            foreach (DataRow dr in dst.Tables[0].Rows)
            {
                if (dr["SubjectID"].ToString().Length > 0)
                {
                    ListItem li = new ListItem(dr["SubjectName"].ToString(), dr["SubjectID"].ToString());
                    this.drpSubject.Items.Add(li);
                }
            }
        }

        public void BindApplyPeriod()
        {
            drpApplyPeriod.Items.Clear();
            ListItem li1 = new ListItem("请选择年度", "-1");
            this.drpApplyPeriod.Items.Add(li1);
            DataSet dstPeriod = PeriodClass.getAllPeriod();
            foreach (DataRow dr in dstPeriod.Tables[0].Rows)
            {
                ListItem itemlist = new ListItem(dr["ApplyPeriodName"].ToString(), dr["ApplyPeriodID"].ToString());
                drpApplyPeriod.Items.Add(itemlist);
            }
        }
    }
}
